package app.web.netant.bangumi;

import cn.lily.com.exception.YaconException;
import cn.lily.web.page.BusinessPage;
import cn.lily.web.widget.sql.TSqlGrid;
import cn.lily.web.widget.standard.TButton;
import cn.lily.web.widget.standard.TButtonPilot;
/**
 * Bangumi游戏数据
 * @author JiaJ
 * @date 2018年6月16日
 *
 */
public class BangumiGamePage extends BusinessPage {

	@Override
	public void page_onLoad() throws YaconException {
		
		TSqlGrid bangumiGameGrid = sqlGrid("bangumiGameGrid");
		
		bangumiGameGrid.setDictTable("LEO_BANGUMI_GAME_INFO");
		String sqlString = "select * from ${schema}.LEO_BANGUMI_GAME_INFO ";
		bangumiGameGrid.setCommSqlStr(sqlString);
		bangumiGameGrid.setEdit(true);
			
		bangumiGameGrid.createFieldTitle("GAME_ID").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_NAME");	
		bangumiGameGrid.createFieldTitle("GAME_NAME_OTH");
		bangumiGameGrid.createFieldTitle("GAME_TAG");
		bangumiGameGrid.createFieldTitle("GAME_URL").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_MEMO").setFieldVisible(false);		
		bangumiGameGrid.createFieldTitle("GAME_URL_ST").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_SALE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_ISSUER").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_MAKER").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_CGS").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_DATE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_DOCTOR").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_WRITER").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_PICTOR").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_TYPE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_SCENE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_CAST").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_LANG").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_ENDS").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_TIMEOUT").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_OPERA").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_MUSIC").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_OS").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_ENGINE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_AGE").setFieldVisible(false);
		bangumiGameGrid.createFieldTitle("GAME_CERO").setFieldVisible(false);
		

		TButtonPilot bangumiGamePilot = ButtonPilot("bangumiGamePilot");
		bangumiGamePilot.setPilotIco("/widget/buttonPilot.gif");
		bangumiGamePilot.setPilotText("Bangumi网站信息");
		
		bangumiGamePilot.addButtons(new TButton("refresh"));
		bangumiGameGrid.setButtonPilot(bangumiGamePilot);
		
		getPage().addElement(bangumiGameGrid);
		
	}
	
	public void refresh() throws YaconException {
		
		TSqlGrid bangumiGameGrid = sqlGrid("bangumiGameGrid");
		
		bangumiGameGrid.setDictTable("LEO_BANGUMI_GAME_INFO");
		String sqlString = "select * from ${schema}.LEO_BANGUMI_GAME_INFO ";
		bangumiGameGrid.setCommSqlStr(sqlString);
		
		this.setSelfMessage(bangumiGameGrid.getDataElement());
		
	}

}
